<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>下载文件选择</title>
    <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.min.css">
  </head>
  <body>
        <form class = "form-horizontal" enctype='multipart/form-data' method='post' action='javascript:;' role = "form" id = "frmUploadFile">
            <div class = "form-group">
                  <label class = "control-label col-sm-2">上传选择</label>
                  <div class = "col-sm-4">
                    <input type = "file" name = "files" class = "form-control" />
                  </div>
            </div>
            <div class = "form-group">
                  <div class = "col-sm-offset-2 col-sm-4">
                    <button class = "btn btn-primary" onClick = "uploadFile()">上传</button>
                    <span class = "help-inline" id = "spanMessage">选择文件，并上传</span>
                  </div>
            </div>
        </form>
        <div class = "row" style = "text-align: center">
          <img id = "imgShow" />
        </div>


        <h1>请选择下载文件：</h1>
        <% if(files.length>0) {%>
        <ul>
          <% files.forEach(function(file){ %>
          <li>
          	<a href="/file/<%- file %>" target="_blank"><%- file %></a>
          </li>
          <%})%>
        </ul>
        <%} else {%>
        <p>没有可下载文件…</p>
        <%}%>
        <script src="./javascripts/jquery.min.js" type="text/javascript"></script>
        <script src="/javascripts/fires.js" ></script> 
  </body>
</html>